Collection of fixes for attestations and platform shenanigans#3379
Closed
jedevc wants to merge 5 commits intomoby:masterfrom
Closed
Collection of fixes for attestations and platform shenanigans#3379jedevc wants to merge 5 commits intomoby:masterfrom
jedevc wants to merge 5 commits intomoby:masterfrom
Conversation
Signed-off-by: Justin Chadwell <me@jedevc.com>
The docker exporter should filter out inline attestations, since it doesn't support them. Any remaining attestations should cause an error, since they have been requested but cannot actually be output. Signed-off-by: Justin Chadwell <me@jedevc.com>
Frontends SHOULD avoid generating SBOMs and Provenance if the backend does not support it. Signed-off-by: Justin Chadwell <me@jedevc.com>
Previous commit to fix platform output wasn't quite right - while the original use case for the multi-platform arg works correctly, it was flawed when used with attestations. We need to fallback to a default of false if no attestations are present. multi-platform still works in this case because of a quirk - if a client has the capability to request attestations, then it will also have the fix that forwards all FrontendOpts to every section of Build, so we can extract multi-platform and pass it to the exporter. Not a perfect solution, but it's not obvious what a more elegant approach would be without a major refactor. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
tonistiigi
reviewed
Dec 12, 2022
|
|
||
| func (c *grpcClient) BuildOpts() client.BuildOpts { | ||
| opts := c.opts | ||
| if c.caps.Supports(pb.CapAttestations) == nil { |
Member
There was a problem hiding this comment.
Supports() == nil means that capability IS supported.
I think the better behavior in this cases would be to make sure AddAttestation is a noop if daemon has no support.
tonistiigi
reviewed
Dec 12, 2022
| } | ||
|
|
||
| isMap := len(inp.Refs) > 0 | ||
| if len(inp.Attestations) > 0 { |
Member
There was a problem hiding this comment.
I do not understand this. Needs a comment. I still don't understand it even after reading the commit message (it says that there is a "flaw" and now things work because of a "quirk" but not what this line really does).
| } | ||
|
|
||
| multiPlatform := len(inp.Refs) > 0 | ||
| if len(inp.Attestations) > 0 { |
Member
There was a problem hiding this comment.
if the len(inp.Refs) > 0 clause above is wrong then it should be removed. If it is not wrong then this patch does not maintain that behavior.
Member
|
CI red |
Member
Author
|
Closed in favor of #3389 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⬆️ Follow-up to #3321